package pers.yurwisher.rubick.nacos.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author yq
 * @date 2021/04/02 13:33
 * @description
 * @since V1.0.0
 */
@RefreshScope
@RestController
public class TestController {
    private final static Logger logger = LoggerFactory.getLogger(TestController.class);

    @Value("${test:123}")
    private String test;

    @GetMapping
    public String echo() {
        return test;
    }

    @PostMapping
    public Object echo(@RequestBody Map<String, Object> map) {
        logger.info("哈哈");
        return map;
    }
}
